package com.board.controller;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.servlet.ModelAndView;

import com.board.dao.BoardDao;
import com.board.domain.BoardCommand;

@Controller
public class MainController {
	
	@Autowired
	private BoardDao boardDao;
	
	@RequestMapping("/board/cmain.do")
	public ModelAndView process(){
		
		List<BoardCommand> getGong = boardDao.getGong();
		
		List<BoardCommand> getJung = boardDao.getJung();
		
		List<BoardCommand> getGallery = boardDao.getGallery();
		
		ModelAndView mav = new ModelAndView();
		
		mav.setViewName("cMain");
		mav.addObject("getGong",getGong);
		mav.addObject("getJung",getJung);
		mav.addObject("getGallery",getGallery);
		
		return mav;
	}
	
	
	
}
